#!/bin/sh

if [ $# -ne 1 ]; then
	echo "Usage: newshellname"
	exit
fi

shellbackupdir=~/workshop/gitee/tools/

shellrundir=/usr/local/bin

grep -w  "## "$1 $shellbackupdir/myshell.md

if [ $? -eq 0 ]; then 
	subl $shellrundir/$1
	exit
fi

if [ -e $shellrundir/$1 ]; then
	echo "this shell alread exit."
	exit
fi

cp $shellbackupdir/empty.sh $shellrundir/$1

echo "## "$1 >> $shellbackupdir/myshell.md

subl $shellrundir/$1

